def translate(s):
    match s:
        case "one":
            return 1
        case "two":
            return 2
        case "three":
            return 3
        case "four":
            return 4
        case "five":
            return 5
        case "six":
            return 6
        case "seven":
            return 7
        case "eight":
            return 8
        case "nine":
            return 9
        case "zero":
            return 0
        case _ :
            return -1
        
def create_num(s):
    summ = 0
    exp = len(s)-1
    for i in range(len(s)):
        summ += s[i]*10**(exp-i)
    return summ

def is_simple_num(a):
    k = 0
    for i in range(2, a // 2+1):
        if (a % i == 0):
            k = k+1
    if (k <= 0):
        return True
    return False

sp = []
s = input().split()
for x in s:
    num = translate(x)
    if num >= 0:
        sp.append(num)
print(sp)
if len(s) != 3:
    print("Wrong input")
else:
    print(n := create_num(sp))
    for x in range(n,-1,-1):
        if is_simple_num(x):
            break
    print(x)    
        
